package com.csun.cmny.provider.dao;

import com.csun.cmny.core.mybatis.MyMapper;
import com.csun.cmny.provider.model.domain.UacUser;
import com.csun.cmny.provider.model.dto.user.BindRoleDto;
import com.csun.cmny.provider.model.dto.user.OmcUserQueryDto;
import com.csun.cmny.provider.model.dto.user.UserQueryDto;
import com.csun.cmny.provider.model.dto.user.UserRoleDto;
import com.csun.cmny.provider.model.vo.OmcUserVo;
import com.csun.cmny.provider.model.vo.OpcUserVo;
import com.csun.cmny.provider.model.vo.RpcUserVo;
import com.csun.cmny.provider.model.vo.UserRoleVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * The interface Uac user mapper.
 *
 * @author paascloud.net @gmail.com
 */
@Mapper
@Component
public interface UacUserMapper extends MyMapper<UacUser> {

	/**
	 * Find by login name uac user.
	 *
	 * @param loginName the login name
	 *
	 * @return the uac user
	 */
	UacUser findByLoginName(String loginName);

	/**
	 * Find by mobile no uac user.
	 *
	 * @param mobileNo the mobile no
	 *
	 * @return the uac user
	 */
	UacUser findByMobileNo(@Param("mobileNo") String mobileNo);

	/**
	 * Find by login name and login pwd uac user.
	 *
	 * @param loginNamePwdMap the login name pwd map
	 *
	 * @return the uac user
	 */
	UacUser findByLoginNameAndLoginPwd(Map<String, String> loginNamePwdMap);

	/**
	 * Select user list list.
	 *
	 * @param uacUser the uac user
	 *
	 * @return the list
	 */
	List<UacUser> selectUserList(UacUser uacUser);

	/**
	 * Select user info by user id uac user.
	 *
	 * @param userId the user id
	 *
	 * @return the uac user
	 */
	UacUser selectUserInfoByUserId(Long userId);

	/**
	 * Update uac user int.
	 *
	 * @param user the user
	 *
	 * @return the int
	 */
	int updateUacUser(UacUser user);

	/**
	 * Select all need bind role list.
	 *
	 * @param superManagerRoleId the super manager role id
	 *
	 * @return the list
	 */
	List<BindRoleDto> selectAllNeedBindRole(@Param("superManagerRoleId") Long superManagerRoleId);

	/**
	 * Find user info by login name uac user.
	 *
	 * @param loginName the login name
	 *
	 * @return the uac user
	 */
	UacUser findUserInfoByLoginName(@Param("loginName") String loginName);

    List<RpcUserVo> queryUserListByRoleCodeAndGroupId(UserRoleDto userRoleDto);

	/**
	 *
	 * @param userQueryDto
	 * @return
	 */
	List<UacUser> queryBindRoleUserList(UserQueryDto userQueryDto);

	 List<OmcUserVo> queryOmcUserListByUserIds(List<Long> userList) ;

	List<OmcUserVo> queryOmcUserListByQueryDto(OmcUserQueryDto omcUserQueryDto);


	//查询机构未分配的护工
	List<OmcUserVo> queryOmcUnUnrsingUserListByUserIds(Map<String,Object>  map) ;

	/**
	 * 查询护工详情
	 * @param: [userId]
	 * @return: com.csun.cmny.provider.model.domain.UacUser
	 */
    UacUser getNursingInfo(@Param("userId") Long userId);

	/**
	 * query opc user vo by user id
	 *
	 * @param userId the user id
	 *
	 * @return the opc user vo
	 */
    OpcUserVo queryOpcUserVoByUserId(Long userId);

    List<UacUser> selectUser(Long groupId);

    List<UserRoleVo> selectUserIdByGroupId(Long groupId);

    List<UserRoleVo> isSalesManager(Long userId);
}